package com.Service.Impl;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.Dao.BaseDaoI;
import com.Entity.ClickInfo;
import com.Service.ClickInfoService;

@Service("clickInfoService")
public class ClickInfoServiceImpl extends BaseServiceImpl<ClickInfo> implements
		ClickInfoService {
	@Autowired
	private BaseDaoI<ClickInfo> clickDao;

	List<ClickInfo> clickList = new ArrayList<ClickInfo>();

	@Override
	public List<ClickInfo> findByUserIdAndNewsId(Integer userid, Long newsid) {
		// TODO Auto-generated method stub
		Map<String, Object> params = new HashMap<String, Object>();
		params.put("userId", userid);
		params.put("infoId", newsid);
		String hql = "from ClickInfo t where t.userId = :userId and t.infoId=:infoId";
		clickList = this.clickDao.find(hql, params);
		return clickList;

	}

}
